home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14326 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  794 b 

  1. Path: news.nask.org.pl!usenet
  2. From: flssoft@blue.maloka.waw.pl (Grzegorz (FLS))
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Problem with append.
  5. Date: Fri, 29 Mar 1996 18:43:00 GMT
  6. Organization: Research and Academic Computer Network
  7. Message-ID: <4jhaqp$hai@bilbo.nask.org.pl>
  8. References: <3156BF02.33A1@affinityedge.com>
  9. NNTP-Posting-Host: s111.maloka.waw.pl
  10. X-Newsreader: Forte Free Agent v0.46
  11.  
  12.  
  13. >out.open(filename, ios::app, 0);
  14.  
  15. >if (!out) {
  16. >  cout << "Cannot open ERROR log file.\n";
  17. >  return(FALSE);
  18. >  }
  19.  
  20.  
  21. >out.close();
  22.  
  23. >This code works the first time, but if the file exists then the 
  24. >routine hangs indefinitely. 
  25.  
  26. Hi,
  27.  
  28. I assume, that you would write cout instead of out, or your out is
  29. cout based.
  30. I think, that if you change 'if (!out)' to 'if out.is_open()' it would
  31. work. Try it.
  32.  
  33.  
  34.